<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>充值页面</title>
<meta name="description"
	content="Source code generated using layoutit.com">
<meta name="author" content="LayoutIt!">

<link href="${basePath}bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="${basePath}bootstrap/css/style.css" rel="stylesheet">
<script src="${basePath}bootstrap/js/jquery.min.js"></script>
<script src="${basePath}bootstrap/js/bootstrap.min.js"></script>
<script src="${basePath}bootstrap/js/scripts.js"></script>
<!--派生选择器设置提示信息的字体颜色-->
<style type="text/css">
div span {
	color: red;
}
</style>
<script type="text/javascript">
	//点击充值金额按钮将对应金额同步到输入框中
	function selectMoney1() {
		//首先清除原来的内容
		document.getElementById("payPaymoney").value = "";
		//同步按钮的对应金额
		document.getElementById("payPaymoney").value = "100";
	}
	//点击充值金额按钮将对应金额同步到输入框中
	function selectMoney2() {
		document.getElementById("payPaymoney").value = "";
		document.getElementById("payPaymoney").value = "50";
	}
	//点击充值金额按钮将对应金额同步到输入框中
	function selectMoney3() {
		document.getElementById("payPaymoney").value = "";
		document.getElementById("payPaymoney").value = "30";
	}
	//金额充值输入框非空验证
	function checkPaymoney() {
		//获取输入的内容
		var payPaymoney = document.getElementById("payPaymoney").value;
		//错误提示框信息内容
		var payMoney = document.getElementById("payMoney");
		if (payPaymoney == null || payPaymoney == "") {
			//提示信息
			payMoney.innerHTML = "请输入或选择充值金额！";
			//改变标志量
			return false;
		} else {
			//清空提示信息
			payMoney.innerHTML = "";
			return true;
		}
	}
	//进行最后的提交验证
	function checkAll() {
		var chMoney = checkPaymoney();
		if (chMoney) {
			return true;
		} else {
			return false;
		}
	}
</script>

</head>
<body>

	<div id="container" align="center">
		<div style="width: 500px;" align="left">
			<h4 align="center">输入用户账户信息进行充值</h4>
			<form class="form-horizontal" role="form" action="getRecharge.do"
				method="post">
				<input type="hidden" id="opreatorName" name="opreatorName"
					value="${opeName0}">

				<div class="form-group">
					<label for="inputUserAccount" class="col-sm-2 control-label">充值账号</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="userAccount"
							id="userAccount" value="${sessionScope.userB.userAccount}"
							readonly />
					</div>
				</div>
				<div class="form-group">
					<label for="inputUserName" class="col-sm-2 control-label">姓名</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="userName"
							id="userName" value="${sessionScope.userB.userName}" readonly />
					</div>
				</div>
				<div class="form-group">
					<label for="inputPayMoney" class="col-sm-2 control-label">充值面额</label>
					<div class="col-sm-5">
						<button type="button" class="btn btn-info" id="money1"
							name="money" onclick="selectMoney1();">¥100</button>
						<button type="button" class="btn btn-info" id="money2"
							name="money" onclick="selectMoney2();">¥50</button>
						<button type="button" class="btn btn-info" id="money3"
							name="money" onclick="selectMoney3();">¥30</button>
					</div>
					<div class="col-sm-5">
						<input type="text" class="form-control" name="payPaymoney"
							id="payPaymoney" />
						<div>
							<span id="payMoney"></span>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-2 col-sm-10">
						<button type="submit" class="btn btn-default"
							onclick="return checkAll();">充值</button>
					</div>
					<div class="col-sm-offset-2 col-sm-10">
						<span>${Errorss}</span>
					</div>
				</div>
			</form>

		</div>
	</div>


</body>
</html>